<?php  
echo $this->session->flash(); 
if(!empty($payableDetailList)){
    $this->Paginator->options(array(
        'update' => '#detailDiv',
        'evalScripts' => true, 
        //'url' => array('controller' => 'Reports', 'action' => 'view_details')
    ));
} 
//pr($payableDetailList);
?>
<div class="file" id="List">
    <table width="100%" border="0" cellspacing="1" cellpadding="2" class="list">
        <tr class="heading" >
            <th width="6%" valign="top" align="left"><?php echo __('S.NO') ?></td>
            <th valign="top"  align="left"><?php echo  __('UNIT_CODE', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('UNIT_NAME', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('PAYEE_ID_PROOF_NO', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('ENG_NAME', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('MPF_STATUS', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('ON_HOLD', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('AMOUNT_PAYABLE', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('BANK_ACCOUNT_NO', true); ?></th>
            <th valign="top"  align ="left"><?php echo __('ACTION', true); ?></th>
        </tr>
        <?php
        if (isset($payableDetailList) && count($payableDetailList) > 0) {
            $i = 0;
            foreach ($payableDetailList as $arrayDetail) {
                ?>
                <tr class="<?php echo (($i%2) == 0)? 'even' : 'odd';?>">
                    <td>&nbsp;<?php echo $i + 1 ?></td>
                    <td>&nbsp;<?php echo $batchListData[$arrayDetail['Payable']['batch_list_id']]['unit_code']; ?></td>
                    <td>&nbsp;<?php echo $batchListData[$arrayDetail['Payable']['batch_list_id']]['unit_name']; ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['Payable']['payee_id_proof_no']; ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['Payable']['e_name']; ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['Payable']['mpf_entitlement']; ?></td>
                    <td>&nbsp;<?php echo ($arrayDetail['Payable']['on_hold'] == 1) ? 'Yes' : 'No'; ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['Payable']['amount_payable']; ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['Payee']['bank_account_no']; ?></td>
                    <td>&nbsp;<?php 
                        echo $this->Html->link(
                                $this->Html->image('icons/16/edit_user.png', array("alt" => "eBox")), '#', array(
                                'target' => '_blank',
                                'escape' => false,
                                'onClick' => "window.open('".$this->Html->url(array(
                                    'controller' => 'reports',
                                    'action' => 'edit_payable/'.$arrayDetail['Payable']['id'],
                                ))."', 'windowname','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=550,height=500'); return false;"
                            ));
                    ?></td>
                </tr>  
                <?php
                $i++;
            }
        }
        ?>
        <tr>
            <td colspan="12" bgcolor="#ffffff" align="center">
                <div class="pagination">            
                    <?php
                    if (!empty($payableDetailList)) {
                        echo $this->Element('pagination_reports');
                    } else {
                        echo __("NO_RECORD_MESSAGE");
                    }
                    ?>              
                </div>
            </td>
        </tr>
    </table>
</div>
<?php echo $this->Js->writeBuffer();?>